/* Copyright 2001,2002,2003 NAH6
 * All Rights Reserved
 *
 * Parts Copyright DoD, Parts Copyright Starium
 *
 */
          /*LINTLIBRARY*/

#include <math.h>
#include "main.h"
#include "celp_sup.h"

          /*PROTOLIB1*/
/***************************************************************************

 ROUTINE
               ham

 FUNCTION
               creates hamming window

 SYNOPSIS
               ham(win,n)
   formal 

                       data    I/O
       name            type    type    function
       -------------------------------------------------------------------
       win            float    i/o     hamming window
       n              int       i      dimension of win

**************************************************************************/
void CreateHam(
float 	win[],
int	n)
{
int 	i;
float 	pi;

        pi = 4.*atan(1.0);
        for(i = 0; i<n;i++)
	   /*win[i] = 0.54-0.46*cos((2.*pi*((double)i))/((double)n-1));*/
    	  win[i] = 0.54 - 0.46 * cos((2.0 * pi * (i)) / (n-1));


}
